<?php


namespace Biz\model\NiceGoodsTopic;

use Biz\model\advertisement\MBaseDbModel;

class FirstTopic extends MBaseDbModel
{
    const _CONFIG_FILE_ = 'db_store';

    const _CONFIG_SELECT_ = 'db_store';

    const _DATABASE_ = 'store';

    const _TABLE_NAME = 'nice_goods_first_topic';

    protected static $format = true;

    public static function pure()
    {
        self::$format = false;
    }

    public static function getInfo($id)
    {
        $rows = self::select('*', ['id' => $id]);

        return current($rows);
    }


    public static function isDel($id)
    {
        return self::count(['topic_status' => self::STATUS_DELETE, 'id' => $id]);
    }

    public static function offline($id)
    {
        self::update(['topic_status' => self::STATUS_DELETE], ['id' => $id]);
    }

    public static function online($id)
    {
        self::update(['topic_status' => self::STATUS_NORMAL], ['id' => $id]);
    }

    public static function getTopicList($where , $field = '*')
    {
        return self::select($field , $where);

    }




}
